package com.zhanjixun.weixin.domain;

import lombok.Data;

import java.io.Serializable;

/**
 * 微信消息
 *
 * @author :zhanjixun
 * @date : 2018/11/18 13:41
 */
@Data
public class WxMsg implements Serializable {

    private String msgId;
    private String fromUserName;
    private String toUserName;
    private Integer msgType;
    private String content;
    private Integer status;
    private Integer imgStatus;
    private Integer createTime;
    //语音长度（单位毫秒）
    private Integer voiceLength;
    //播放长度（单位秒）
    private Integer playLength;
    private String fileName;
    private String fileSize;
    private String mediaId;
    private String url;
    private Integer appMsgType;
    private Integer statusNotifyCode;
    private String statusNotifyUserName;
    private RecommendInfo recommendInfo;
    private Integer forwardFlag;
    private AppInfo appInfo;
    private Integer hasProductId;
    private String ticket;
    private Integer imgHeight;
    private Integer imgWidth;
    private Integer subMsgType;
    private Long newMsgId;
    private String oriContent;
    private String encryFileName;

    /**
     * 是否是群组消息
     * <p>
     * 群聊的userName是由@@开头的.
     * 消息的fromUserName如果是@@开头则为群聊消息
     * 群消息与普通消息不同的是在其消息体（Content）中
     * 会包含发送者userName及":<br/>"消息
     *
     * @return
     */
    public boolean isGroupMsg() {
        return fromUserName.startsWith("@@");
    }

}
